import { request } from '@/utils/request'

export function checkToken() {
  return request({
    url: '/api/user/checkToken',
    method: 'post'
  })
}

export function logout() {
  return request({
    url: '/api/user/logout',
    method: 'post'
  })
}

export function login(data) {
  return request({
    url: `/api/user/login`,
    method: 'post',
    data: JSON.stringify(data),
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

export function register(data) {
  return request({
    url: `/api/user`,
    method: 'post',
    data: JSON.stringify(data),
    headers: {
      'Content-Type': 'application/json'
    }
  })
}
